home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_15 / PlaceObject2_418_269 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  1.3 KB  |  58 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipW")
  3.    {
  4.       xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  5.       yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  6.       _X = _X + xspeed;
  7.       _Y = _Y + yspeed;
  8.       _rotation = _rotation + rspeed * speed;
  9.       xx = random(20);
  10.       if(xx == 0)
  11.       {
  12.          rspeed *= -1;
  13.       }
  14.       xx = random(70);
  15.       if(xx == 0)
  16.       {
  17.          speed = 13;
  18.          rspeed = 1.2;
  19.          timer = 30;
  20.       }
  21.       timer -= 1;
  22.       if(timer == 0)
  23.       {
  24.          speed = 5;
  25.          rspeed = 0.6;
  26.       }
  27.       if(_X < -100 || _X > 650 || _Y < -100 || _Y > 500 || _root.rem == true)
  28.       {
  29.          removeMovieClip(this);
  30.       }
  31.       var i = 0;
  32.       while(i <= 20)
  33.       {
  34.          if(sh.harea.hitTest(_root["hmn" + i]))
  35.          {
  36.             life -= _root["hmn" + i].dmg;
  37.             sh.play();
  38.             removeMovieClip(_root["hmn" + i]);
  39.          }
  40.          i++;
  41.       }
  42.       if(_root.ship.sh.hitTest(sh.harea))
  43.       {
  44.          play();
  45.          _root.ship.play();
  46.       }
  47.       if(life <= 0)
  48.       {
  49.          play();
  50.       }
  51.       yy = random(60);
  52.       if(yy == 0)
  53.       {
  54.          _root.fire(this);
  55.       }
  56.    }
  57. }
  58.